import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';

class HomeBanner extends StatelessWidget {
  const HomeBanner({super.key, required this.bannerList});

  final List bannerList;

  @override
  Widget build(BuildContext context) {
    return CarouselSlider(
      items: bannerList.map((item) {
        return GestureDetector(
          onTap: () {},
          child: Container(
            margin: const EdgeInsets.all(10),
            child: Image.network(item['imgUrl']),
          ),
        );
      }).toList(),
      options: CarouselOptions(
        autoPlay: true,
        autoPlayInterval: const Duration(seconds: 3),
        height: 200,
      ),
    );
  }
}
